package gossip.v2.test;


import gossip.v2.GossipCore;
import gossip.v2.cluster.GossipNode;

public class GossipService {
    public static void main(String[] args) {
        // 创建本地节点
        GossipNode localNode = new GossipNode("node-1", "192.168.1.100", 8080);

        // 初始化Gossip核心
        GossipCore core = new GossipCore(localNode);

        // 添加种子节点
        core.getClusterManager().addSeedNode(new GossipNode("seed-1", "192.168.1.101", 8080));
        core.getClusterManager().addSeedNode(new GossipNode("seed-2", "192.168.1.102", 8080));

        // 注册业务监听器
//        core.addListener(new ServiceDiscoveryListener());

        // 启动服务
        core.start();

        // 更新状态示例
        core.updateState("config.max_connections", "500".getBytes());
    }
}
